package com.dfbz.demo01;

import java.util.Scanner;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo05_Scanner小练习_01_求最大值 {
    public static void main(String[] args) {


        // 创建一个扫描器
        Scanner scanner = new Scanner(System.in);


        System.out.println("请输入第1个数: ");
        int a = scanner.nextInt();

        System.out.println("请输入第2个数: ");
        int b = scanner.nextInt();

        System.out.println("请输入第3个数: ");
        int c = scanner.nextInt();


        int max = a > b ? (a > c ? a : c) : (b > c ? b : c);

/*        int max = 0;
        if (a > b) {

            if (a > c) {
                max = a;
            } else {
                max = c;
            }
        } else {
            // 说明b大

            if (b > c) {
                max = b;
            } else {
                max = c;
            }
        }*/

        System.out.println("最大值为: " + max);

    }
}
